package com.dengqi.mymodule.activity.glide.activity;

import android.os.Bundle;

import com.dengqi.mymodule.BaseActivity;
import com.dengqi.mymodule.R;
import com.dengqi.mymodule.activity.glide.adapter.FragmentViewPagerAdatper;

import java.util.ArrayList;
import java.util.List;

import androidx.viewpager.widget.ViewPager;

/**
 * 图片下限
 * glide 格莱德
 * guide 盖德
 * gradle 格瑞德
 * Created by dell on 2018/6/20
 */
public class GlideFragmentPagerActivity extends BaseActivity {

    ViewPager viewPager;
    FragmentViewPagerAdatper adatper;
    String url = "http://t1.mmonly.cc/uploads/tu/sm/201602/19/%s.jpg";
    List<String> strs;
    int count = 100;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_glide_viewpager);
        initData();

        viewPager = findViewById(R.id.viewPager);
        adatper = new FragmentViewPagerAdatper(getSupportFragmentManager(), this, strs);
        viewPager.setAdapter(adatper);
        viewPager.setOffscreenPageLimit(0);

    }

    private void initData() {
        strs = new ArrayList<>();
        strs.add("https://desk-fd.zol-img.com.cn/t_s2560x1600c5/g5/M00/02/09/ChMkJlbKzgeIIIVKABqyglb_D50AALJGwEopAgAGrKa319.jpg");
        strs.add("https://desk-fd.zol-img.com.cn/t_s2880x1800c5/g5/M00/04/0E/ChMkJlxG_ruIR3nAABa65fI7gMMAAuhmQIXEVwAFrr9023.jpg");

        strs.add("https://desk-fd.zol-img.com.cn/t_s2880x1800c5/g5/M00/04/0D/ChMkJ1xG8LSIJW9VABcyu5MciNcAAuhigPj-hMAFzLT167.jpg");
        strs.add("https://desk-fd.zol-img.com.cn/t_s2880x1800c5/g5/M00/04/0E/ChMkJ1xG8LOISDE0AENk28OsmWwAAuhiwDQMkoAQ2Tz651.jpg");

        strs.add("https://desk-fd.zol-img.com.cn/t_s2880x1800c5/g5/M00/04/0E/ChMkJ1xG8LKIdHRcAC7m8mwRcCoAAuhiwChS0AALucK164.jpg");
        strs.add("https://desk-fd.zol-img.com.cn/t_s2880x1800c5/g5/M00/04/0E/ChMkJlxG8LCIKhloAFJX_79oIb0AAuhiwBO8ykAUlgX010.jpg");

        strs.add("https://desk-fd.zol-img.com.cn/t_s2880x1800c5/g5/M00/04/0E/ChMkJ1xHDMyIeU7lADaH5QgJKt8AAuhqwOdXR0ANof9085.jpg");
        strs.add("https://desk-fd.zol-img.com.cn/t_s2880x1800c5/g5/M00/04/0E/ChMkJlxG_ryIU3JAAD1LEZRiIU0AAuhmQIw7yAAPUsp000.jpg");

        strs.add("https://desk-fd.zol-img.com.cn/t_s2880x1800c5/g5/M00/04/0E/ChMkJ1xG8K-IEZ2nAE7zERQJRYMAAuhiwAAAAAATvMp234.jpg");
        strs.add("https://desk-fd.zol-img.com.cn/t_s2880x1800c5/g5/M00/04/0D/ChMkJlxG8K2IRzNNAGjycYMFjlUAAuhigNlGpAAaPKJ003.jpg");
//        for(int i=0;i<count;i++){
//            strs.add(String.format(url, i+1));
//        }

    }

}
